<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Select topics</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
	</head>
	
	<body>
	<div id="wrapper">
	
		<%@ include file="headerNews.jsp" %>
		
		<%@ include file="menuNews.jsp" %>
		
		<div id="page">
		<div id="page-bgtop">
		<div id="page-bgbtm">
		
		<div id="content">
	
		<div>
			<h1 class="mainText">Select the topics you want to subscribe to in each newspaper</h1>
		</div>

		<div>
    		<form action="subscribe" method="post">
<!--			CHANGE TO GET WHEN WE USE TAGS-->
<!-- 			<form action="subscribe" method="get"> -->
				<c:forEach var="np" items="${selectedNPs}">
					<div><h3>${npList[np].name}</h3></div>
					<div>
						<!-- <div>
							<input type="checkbox" name="selTopics" value="${npList[np].topicPrefix}.*" /> Entire newspaper
						</div> -->
						<c:forEach var="topic" items="${npList[np].topics}">
							<c:set var="topicString" value="${topic}"/>
             				<c:set var="topicPrefixString" value="${npList[np].topicPrefix}."/>
							<div>
								<input type="checkbox" name="selTopics" value="${topic}" /> ${fn:substringAfter(topicString, topicPrefixString)}
							</div>
						</c:forEach>
					</div>
				</c:forEach>
	            <div>
	                <input type="submit" class="bigButton" name="submitTopics" value="Send selection" />
	            </div>
			</form>
		</div>
		
		<div style="clear: both;">&nbsp;</div>
		
		</div>
		
		<%@ include file="sidebarNews.jsp" %>
		<div style="clear: both;">&nbsp;</div>
		
		</div>
		</div>
		</div>
		
		<%@ include file="footerNews.jsp" %>

	</div>
	</body>
	
</html>